//2009/08/18 18:18:35
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class HammingDistance
{
public:
    int minDistance(vector <string> numbers)
    {
		int ret = -1;
		for(int i=0; i<numbers.size(); i++)
		{
			for(int j=0; j<numbers.size(); j++)
			{
				if(i!=j)
				{
					int temp = 0;
					for(int k=0; k<numbers[i].size(); k++)
					{
						if(numbers[i][k] != numbers[j][k]) 
							temp ++;
					}
					if(temp < ret || ret == -1) ret = temp;
				}
			}
		}
		return ret;
    }
};
